// components/collaspe/collaspe.js
Component({
      /**
       * 组件的属性列表
       */
      properties: {
        title: {
          type: String,
          value: ''
        },
        show: {
          type: Boolean,
          value: false, 
          observer(newVal, oldVal, changedPath) {
            this.setData({
              collaspeFlag: newVal
            })
          },
        },
          showEdit: {
            type: Boolean,
            value: false,
            observer(newVal, oldVal, changedPath) {
              this.setData({
                showEditFlag: newVal
              })
            }
          }
        },

        /**
         * 组件的初始数据
         */
        data: {
          collaspeFlag: false,
          showEditFlag: false,
          editing: false
        },

        /**
         * 组件的方法列表
         */
        methods: {
          changeShow() {
            let show = !this.data.collaspeFlag
            this.triggerEvent('collaspe', {show: show });
            this.setData({
              collaspeFlag: show
            })
            
          },
          onEdit() {
            let editing = !this.data.editing
            this.triggerEvent('onEdit', { editing: editing });
            this.setData({
              editing: editing
            })
          }
        }
      })